Skip to content

Add Euclidean algorithm in Ruby #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 6, 2018
Merged

Add Euclidean algorithm in Ruby #447

merged 6 commits into from
Oct 6, 2018

Conversation

nic-hartley
Copy link
Contributor

Noticed a little hole in our defenses coverage, and I like Ruby, so have another non-Factor PR.

@Gathros Gathros added Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) Hacktoberfest The label for all Hacktoberfest related things! labels Oct 4, 2018
Copy link
Member

@jiegillet jiegillet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other implementations usually do something like a = abs(a) to take care of the negative case which can lead to infinite loops. Could you add that? Your code looks fine otherwise.

@jiegillet
Copy link
Member

One more thing, could you write the test numbers in a factorized form to maximize readability? Ex: 48 => 4 * 12

@jiegillet jiegillet self-assigned this Oct 5, 2018
@nic-hartley
Copy link
Contributor Author

@jiegillet Fixed both

Copy link
Member

@jiegillet jiegillet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! Thank you

@jiegillet jiegillet merged commit ef58ca9 into algorithm-archivists:master Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest The label for all Hacktoberfest related things! Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants